class_name ECSTool


static func is_component(node: Node) -> bool:
	return true if node.get("component_name") else false


static func is_multi(node: Node) -> bool:
	return node is Multi


static func is_single(node: Node) -> bool:
	return node is Single


static func is_entity(node: Node) -> bool:
	return node.is_in_group("Entity")


static func is_system(node: Node) -> bool:
	return true if node.get("system_name") else false


static func matches_entity_filter(entity: Node, filter: Array) -> bool:
	var entity_class: String = entity.get_class()
	if not entity_class in filter or "!%s" % entity_class in filter:
		return false
	return true


const time_map := {}


static func time(key):
	var s = Time.get_ticks_usec()
	time_map[key] = s


static func time_end(key):
	var e = Time.get_ticks_usec()
	var s = time_map[key]
	if not s:
		print("%s time cost must call time first" % key)
		return
	print("[%s]:%d" % [key, e])
